package com.fc.service.impl

import java.util.List;

import org.springframework.stereotype.Repository
import org.springframework.transaction.annotation.Transactional;

import com.fc.service.RoleService
import com.fc.entities.Role

@Repository("roleService")
@Transactional
class RoleServiceImpl extends BaseServiceImpl<Role> implements RoleService  {
	@Override
	Role getUserRole() {
		List<Role> roles = super.findAll(Role.class)
		def userRole = roles.find() { it.name = 'ROLE_USER' }
		return userRole
	}

	@Override
	List<Role> findAll() {
		findAll(Role.class)
	}
}
